home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Util / conv / SteBaseConv.lha / Convertitore / Convertitore.text < prev    next >
Text File  |  2004-08-29  |  15KB  |  612 lines

  1. ;***************************************************************************
  2. ;*                                                                         *
  3. ;* Convertitore decimale, complemento a due, esadecimale, ottale e binario *
  4. ;*                                                                         *
  5. ;***************************************************************************
  6. ;d> 20 aprile 2003 (Easter Day) from a Blitz2 Manual example
  7. ;m> 21 aprile 2003 (Angel Day)
  8. ;m> 26,27 aprile 2003
  9. ;m> 22,24 maggio 2003
  10. ;m> 8 giugno 2003
  11. ;m> 16 maggio 2004
  12. ;m> 30 giugno 2004
  13. ;m> 29 agosto 2004
  14. ;------------------
  15.  
  16. ;the following lines of code are for correct program's version handling
  17. JMP InizioDelProgramma
  18.  
  19. Dc .b "$VER: Convertitore 1.6 (29.8.2004)"
  20. Even
  21.  
  22. InizioDelProgramma
  23. ;program start
  24.  
  25. #ListaBottoni=0
  26. ;gadgetlist identifier
  27.  
  28. ;kind of gadget flags
  29. #SoloDueValori=1
  30. ;toggle gadget
  31.  
  32. #LatoDestroFinestra=2
  33. ;window's right side related
  34.  
  35. #LatoBassoFinestra=4
  36. ;window's bottom side related
  37.  
  38. #LarghezzaFinestra=8
  39. ;window's width related
  40.  
  41. #AltezzaFinestra=16
  42. ;window's height related
  43.  
  44. #PiuDiDueValori=32
  45. ;more than two values
  46.  
  47. #MovimentoOrizzontale=64
  48. ;orizontal slider
  49.  
  50. #MovimentoVerticale=128
  51. ;vertical slider
  52.  
  53. #ProporzionaliSenzaBordo=256
  54. ;borderless slider
  55.  
  56. #SoloUnoTraTanti=512
  57. ;one from many
  58.  
  59. #AttaccaADestra=1024
  60. ;attach to window's right side
  61.  
  62. #AttaccaASinistra=2048
  63. ;attach to window's left side
  64.  
  65. #AttaccaInAlto=4096
  66. ;Attach to window's top side
  67.  
  68. #AttaccaInBasso=8192
  69. ;attach to window's bottom side
  70.  
  71. #BordoDammiZeroZero=16384
  72. ;gimme zero zero border
  73.  
  74. ;gadget identifier
  75. #CampoDiTestoDecimale=0
  76. ;decimal text field
  77.  
  78. #CampoDiTestoComplementoADue=1
  79. ;two complement text field
  80.  
  81. #CampoDiTestoEsadecimale=2
  82. ;hexadecimal text field
  83.  
  84. #CampoDiTestoOttale=3
  85. ;octal text field
  86.  
  87. #CampoDiTestoBinario=4
  88. ;binary text field
  89.  
  90. #FinestraConvertitore=0
  91. ;converter window identifier
  92.  
  93. #FinestraCrediti=1
  94. ;credits window identifier
  95.  
  96. ;kind of window flags
  97. #BottoneDimensionamentoFinestra=1
  98. ;window's sizing gadget
  99.  
  100. #SpostamentoFinestra=2
  101. ;draggable window
  102.  
  103. #ProfonditaFinestra=4
  104. ;window's depth gadget
  105.  
  106. #BottoneChiusuraFinestra=8
  107. ;window's close gadget
  108.  
  109. #BloccaDisegnoDestra=16
  110. ;clip right drawing
  111.  
  112. #BloccoDisegnoSotto=32
  113. ;clip bottom drawing
  114.  
  115. #FinestraComeSfondo=256
  116. ;backdrop window
  117.  
  118. #DammiZeroZero=1024
  119. ;gimme zero zero
  120.  
  121. #FinestraSenzaBordo=2048
  122. ;borderless window
  123.  
  124. #FinestraAttiva=4096
  125. ;window active
  126.  
  127. ;window events
  128. #HaiRidimensionatoLaFinestra=2
  129. ;you have resized the window
  130.  
  131. #LaFinestraECorrotta=4
  132. ;the window is corrupted
  133.  
  134. #HaiPremutoUnTastoDelTopo=8
  135. ;you have pressed a mouse button
  136.  
  137. #HaiMossoIlTopo=16
  138. ;you have moved the mouse
  139.  
  140. #HaiPremutoUnBottone=32
  141. ;you have pressed a gadget
  142.  
  143. #HaiRilasciatoUnBottone=64
  144. ;you have released a gadget
  145.  
  146. #HaiAttivatoIlMenu=256
  147. ;you have activated the menu
  148.  
  149. #HaiChiusoLaFinestra=512
  150. ;you have closed the window
  151.  
  152. #HaiPremutoUnTasto=1024
  153. ;you have pressed a key
  154.  
  155. #HaiInseritoUnDischetto=32768
  156. ;you have inserted a disk
  157.  
  158. #HaiToltoUnDischetto=65536
  159. ;you have removed a disk
  160.  
  161. #HaiAttivatoLaFinestra=262144
  162. ;you have activated the window
  163.  
  164. #HaiDisattivatoLaFinestra=524288
  165. ;you have deactivated the window
  166.  
  167. #ListaMenu=0
  168. ;menulist identifier
  169.  
  170. ;kind of menu item flags
  171. #VoceNormale=0
  172. ;normal item
  173.  
  174. #VoceSelettiva=1
  175. ;item with checkmark
  176.  
  177. #VoceSelettivaMultipla=2
  178. ;select one from two or more items
  179.  
  180. #VoceSelettivaSelezionata=3
  181. ;item selected
  182.  
  183. #VoceSelettivaMultiplaSelezionata=4
  184. ;one from two or more items selected
  185.  
  186. ;menu settings
  187. #Menu=0
  188. ;menu identifier
  189.  
  190. #VoceZero=0
  191. ;first menu item
  192.  
  193. #VoceUno=1
  194. ;second menu item
  195.  
  196. #VoceDue=2
  197. ;third menu item
  198.  
  199. ;language selection
  200. #Italiano=1
  201. ;italian
  202.  
  203. #Inglese=2
  204. ;english
  205.  
  206. #ValoreMassimo=16777215
  207. ;maximum value
  208.  
  209. ;ascii values for used keys
  210. #TabulationASCII=9
  211. #LineFeedASCII=10
  212. #CarriageReturnASCII=13
  213. #EscapeASCII=27
  214. #CursorUpASCII=28
  215. #CursorDownASCII=29
  216. #CursorRightASCII=30
  217. #CursorLeftASCII=31
  218.  
  219. ;workbench screen identifier number
  220. #SchermoWB=0
  221.  
  222. #Cursore=1
  223. ;cursor lenght in chars
  224.  
  225. TastoTabulazione$=Chr$(#TabulationASCII)
  226. ;tabulation char
  227.  
  228. NuovaLinea$=Chr$(#LineFeedASCII)
  229. ;new line char
  230.  
  231. Invio$=Chr$(#CarriageReturnASCII)
  232. ;carriage return char
  233.  
  234. TastoEsc$=Chr$(#EscapeASCII)
  235. ;escape char
  236.  
  237. TastoCursoreSu$=Chr$(#CursorUpASCII)
  238. ;cursor up char
  239.  
  240. TastoCursoreGiu$=Chr$(#CursorDownASCII)
  241. ;cursor down char
  242.  
  243. TastoCursoreDestra$=Chr$(#CursorRightASCII)
  244. ;cursor right char
  245.  
  246. TastoCursoreSinistra$=Chr$(#CursorLeftASCII)
  247. ;cursor left char
  248.  
  249. DEFTYPE .b
  250.  
  251. Statement MostraLaBaseCorrente{Base}
  252. SHARED AltezzaLineaBase
  253. SHARED Lingua
  254.  Select Lingua
  255.  Case #Italiano
  256.   If Base=1 Then WColour 2,3
  257.   WLocate 1,1
  258.   Print "Decimale   ":WColour 1,0
  259.   If Base=2 Then WColour 2,3
  260.   WLocate 1,1+AltezzaLineaBase+1
  261.   Print "Complemento":WColour 1,0
  262.   If Base=3 Then WColour 2,3
  263.   WLocate 1,1+(AltezzaLineaBase+1)*2
  264.   Print "Esadecimale":WColour 1,0
  265.   If Base=4 Then WColour 2,3
  266.   WLocate 1,1+(AltezzaLineaBase+1)*3
  267.   Print "Ottale     ":WColour 1,0
  268.   If Base=5 Then WColour 2,3
  269.   WLocate 1,1+(AltezzaLineaBase+1)*4
  270.   Print "Binario    ":WColour 1,0
  271.  Case #Inglese
  272.   If Base=1 Then WColour 2,3
  273.   WLocate 1,1
  274.   Print "Decimal    ":WColour 1,0
  275.   If Base=2 Then WColour 2,3
  276.   WLocate 1,1+AltezzaLineaBase+1
  277.   Print "Complement ":WColour 1,0
  278.   If Base=3 Then WColour 2,3
  279.   WLocate 1,1+(AltezzaLineaBase+1)*2
  280.   Print "Hexadecimal":WColour 1,0
  281.   If Base=4 Then WColour 2,3
  282.   WLocate 1,1+(AltezzaLineaBase+1)*3
  283.   Print "Octal      ":WColour 1,0
  284.   If Base=5 Then WColour 2,3
  285.   WLocate 1,1+(AltezzaLineaBase+1)*4
  286.   Print "Binary     ":WColour 1,0
  287.  End Select
  288. End Statement
  289.  
  290. Function $ ConvertiInOttale{ValoreDecimale.l}
  291.  Peso.l=1
  292.  If ValoreDecimale>=0
  293.   While Peso<#ValoreMassimo
  294.    CifraOttale$=Str$((ValoreDecimale/Peso) MOD 8)
  295.    ValoreOttale$=CifraOttale$+ValoreOttale$
  296.    Peso*8
  297.   Wend
  298.  Else
  299.   ValoreDecimale+1
  300.   While -Peso>-#ValoreMassimo-1
  301.    CifraOttale$=Str$(7-(-ValoreDecimale/Peso) MOD 8)
  302.    ValoreOttale$=CifraOttale$+ValoreOttale$
  303.    Peso*8
  304.   Wend
  305.  EndIf
  306. Function Return ValoreOttale$
  307. End Function
  308.  
  309. WBStartup
  310. ;the program can be executed from workbench
  311.  
  312. WbToScreen #SchermoWB
  313. ;workbench can be used as screen zero
  314.  
  315. AltezzaFonteFinestre=8
  316. AltezzaFonteSchermo=8
  317. OpenFontPrefs
  318.  AltezzaFonteSchermo=DefaultFontHeight(2)
  319.  AltezzaFonteFinestre=DefaultFontHeight(1)
  320. CloseFontPrefs
  321. ;obtain the font height of screen and system fonts
  322.  
  323. AltezzaBarraTitoloWorkbench=AltezzaFonteSchermo+3
  324. ;workbench screenbar height
  325.  
  326. AltezzaCampoDiTesto=12
  327. ;text field height
  328.  
  329. AltezzaLineaBase=Max(AltezzaCampoDiTesto,AltezzaFonteFinestre)
  330. ;base line height
  331.  
  332. Select UCase$(ProgName$)
  333. Case "CONVERTITORE"
  334.  Lingua=#Italiano
  335. ;italian language
  336. Case "CONVERTER"
  337.  Lingua=#Inglese
  338. ;english language
  339. Default
  340.  EZRequest "Converter request","You must rename the prog|Convertitore or Converter!","OK"
  341.  Goto FineDelProgramma
  342. End Select
  343.  
  344. YPosBottone=1
  345. XLunBottoni.w=8*25
  346. YPosFinestra.w=AltezzaBarraTitoloWorkbench
  347. YLunFinestra=AltezzaBarraTitoloWorkbench+1+(AltezzaLineaBase+1)*5+2
  348. TipoFinestra.l=#SpostamentoFinestra+#ProfonditaFinestra+#BottoneChiusuraFinestra+#DammiZeroZero+#FinestraAttiva
  349.  
  350. Repeat
  351.  
  352.  Select Lingua
  353.  Case #Italiano
  354.   XPosBottoni.w=1+Len("Esadecimale")*8+1
  355.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoDecimale,8+#Cursore,XLunBottoni
  356.   YPosBottone+AltezzaLineaBase+1
  357.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoComplementoADue,9+#Cursore,XLunBottoni
  358.   YPosBottone+AltezzaLineaBase+1
  359.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoEsadecimale,6+#Cursore,XLunBottoni
  360.   YPosBottone+AltezzaLineaBase+1
  361.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoOttale,8+#Cursore,XLunBottoni
  362.   YPosBottone+AltezzaLineaBase+1
  363.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoBinario,24+#Cursore,XLunBottoni
  364.  
  365.   MenuTitle #ListaMenu,#Menu,"Informazioni"
  366.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceZero,"Crediti     ","C"
  367.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceUno, "English     ","L"
  368.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceDue, "Esci        ","Q"
  369.  
  370.   XLunFinestra.w=4+XPosBottoni+4+XLunBottoni+4+1+4
  371.   Window #FinestraConvertitore,0,YPosFinestra,XLunFinestra,YLunFinestra,TipoFinestra,"Convertitore Basi",1,2,#ListaBottoni
  372.   SetMenu #ListaMenu
  373.   MostraLaBaseCorrente{BottoneAttivo+1}
  374.  Case #Inglese
  375.   XPosBottoni=1+Len("Hexadecimal")*8+1
  376.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoDecimale,8+#Cursore,XLunBottoni
  377.   YPosBottone+AltezzaLineaBase+1
  378.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoComplementoADue,9+#Cursore,XLunBottoni
  379.   YPosBottone+AltezzaLineaBase+1
  380.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoEsadecimale,6+#Cursore,XLunBottoni
  381.   YPosBottone+AltezzaLineaBase+1
  382.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoOttale,7+#Cursore,XLunBottoni
  383.   YPosBottone+AltezzaLineaBase+1
  384.   StringGadget #ListaBottoni,XPosBottoni,YPosBottone,0,#CampoDiTestoBinario,24+#Cursore,XLunBottoni
  385.  
  386.   MenuTitle #ListaMenu,#Menu,"Information"
  387.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceZero,"Credits    ","C"
  388.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceUno,"Italiano    ","L"
  389.   MenuItem #ListaMenu,#VoceNormale,#Menu,#VoceDue,"Quit        ","Q"
  390.  
  391.   XLunFinestra=4+1+XPosBottoni+1+4+XLunBottoni+4+1+4
  392.   Window #FinestraConvertitore,0,YPosFinestra,XLunFinestra,YLunFinestra,TipoFinestra,"Base Converter",1,2,#ListaBottoni
  393.   SetMenu #ListaMenu
  394.   MostraLaBaseCorrente{BottoneAttivo+1}
  395.  End Select
  396.  
  397.  Repeat
  398.  
  399.   EventoFinestra.l=WaitEvent
  400.  
  401.   HaiPremutoUnBottone.l=EventoFinestra & %0000000000100000
  402.   If HaiPremutoUnBottone=#HaiPremutoUnBottone
  403. ;if text field selected
  404.  
  405.    BottoneAttivo=GadgetHit
  406.    MostraLaBaseCorrente{BottoneAttivo+1}
  407.   EndIf
  408.  
  409.   HaiRilasciatoUnBottone.l=EventoFinestra & %0000000001000000
  410.   If HaiRilasciatoUnBottone=#HaiRilasciatoUnBottone
  411.  ;if text field selected and then Return pressed
  412.  
  413.    BottoneAttivo=GadgetHit
  414.    Select BottoneAttivo
  415.    Case #CampoDiTestoDecimale
  416.     NuovoValore.l=Val(StringText$(#ListaBottoni,#CampoDiTestoDecimale))
  417.     If NuovoValore>-1 AND NuovoValore<16777216
  418.      Complemento.l=1
  419.      Repeat
  420.       Complemento*2
  421.      Until Complemento>=NuovoValore
  422.     Else
  423.      Pop If:Pop Select:Goto FineSelezioneCampo
  424.     EndIf
  425.    Case #CampoDiTestoComplementoADue
  426.     NuovoValore=Val(StringText$(#ListaBottoni,#CampoDiTestoComplementoADue))
  427.     If NuovoValore>-16777217 AND NuovoValore<0
  428.      Complemento=1
  429.      Repeat
  430.       Complemento*2
  431.      Until Complemento>=-NuovoValore
  432.      NuovoValore=-Complemento
  433.     Else
  434.      Pop If:Pop Select:Goto FineSelezioneCampo
  435.     EndIf
  436.    Case #CampoDiTestoEsadecimale
  437.     Valore$=UCase$(StringText$(#ListaBottoni,#CampoDiTestoEsadecimale))
  438.     NuovoValore=0
  439.     PosizioneStringa=Len(Valore$)
  440.     Peso.l=1
  441.     Complemento=0
  442.     While PosizioneStringa>0
  443.      Cifra=Asc(Mid$(Valore$,PosizioneStringa,1))
  444.      If Cifra>47 AND Cifra<58
  445.       Cifra-48
  446.      Else
  447.       If Cifra>64 AND Cifra<71
  448.        Cifra-55
  449.       Else
  450.        Pop If:Pop While:Pop Select:Goto FineSelezioneCampo
  451.       EndIf
  452.      EndIf
  453.      NuovoValore+Cifra*Peso
  454.      PosizioneStringa-1
  455.      Peso*16
  456.     Wend
  457.     If Cifra>0 Then Complemento=Peso
  458.    Case #CampoDiTestoOttale
  459.     Valore$=StringText$(#ListaBottoni,#CampoDiTestoOttale)
  460.     NuovoValore=0
  461.     PosizioneStringa=Len(Valore$)
  462.     Peso=1
  463.     Complemento=0
  464.     While PosizioneStringa>0
  465.      Cifra=Asc(Mid$(Valore$,PosizioneStringa,1))
  466.      If Cifra>47 AND Cifra<56
  467.       Cifra-48
  468.      Else
  469.       Pop If:Pop While:Pop Select:Goto FineSelezioneCampo
  470.      EndIf
  471.      NuovoValore+Cifra*Peso
  472.      PosizioneStringa-1
  473.      Peso*8
  474.     Wend
  475.     If Cifra>0 Then Complemento=Peso
  476.    Case #CampoDiTestoBinario
  477.     Valore$=StringText$(#ListaBottoni,#CampoDiTestoBinario)
  478.     NuovoValore=0
  479.     PosizioneStringa=Len(Valore$)
  480.     Peso=1
  481.     Complemento=0
  482.     While PosizioneStringa>0
  483.      Cifra=Asc(Mid$(Valore$,PosizioneStringa,1))
  484.      If Cifra>47 AND Cifra<50
  485.       Cifra-48
  486.      Else
  487.       Pop If:Pop While:Pop Select:Goto FineSelezioneCampo
  488.      EndIf
  489.      NuovoValore+Cifra*Peso
  490.      PosizioneStringa-1
  491.      Peso*2
  492.     Wend
  493.     If Cifra>0 Then Complemento=Peso
  494.    End Select
  495. FineSelezioneCampo
  496.  
  497.    If NuovoValore<>Valore.l
  498. ;if there is a new value
  499.  
  500.     Valore=NuovoValore
  501.     SetString #ListaBottoni,#CampoDiTestoDecimale,Str$(Valore)
  502.     SetString #ListaBottoni,#CampoDiTestoComplementoADue,Str$(-Complemento)
  503.     SetString #ListaBottoni,#CampoDiTestoEsadecimale,Right$(Hex$(Valore),6)
  504.     SetString #ListaBottoni,#CampoDiTestoOttale,Right$(ConvertiInOttale{Valore},8)
  505.     SetString #ListaBottoni,#CampoDiTestoBinario,Right$(Bin$(Valore),24)
  506.     Redraw #FinestraConvertitore
  507.    EndIf
  508.  
  509.    MostraLaBaseCorrente{BottoneAttivo+1}
  510.   EndIf
  511.  
  512.   NuovaLingua=0
  513.   ;new language
  514.  
  515.   HaiAttivatoIlMenu.l=EventoFinestra & %0000000100000000
  516.   If HaiAttivatoIlMenu=#HaiAttivatoIlMenu
  517. ;if the menu has been activated
  518.  
  519.    If MenuHit=#Menu
  520.     Select ItemHit
  521.     Case #VoceZero
  522.      Select Lingua
  523.      Case #Italiano
  524.       TitoloPannelloCrediti$="Crediti"
  525.       Crediti$="Convertitore Basi 1.4|"
  526.       Crediti$+"domenica, 16 maggio 2004|"
  527.       Crediti$+"di Stefano Maria Regattin|"
  528.       Crediti$+"dal manuale cartaceo|"
  529.       Crediti$+"di Blitz Basic 2.1"
  530.      Case #Inglese
  531.       TitoloPannelloCrediti$="Credits"
  532.       Crediti$="Base Converter 1.4|"
  533.       Crediti$+"Sunday, 16th May 2004|"
  534.       Crediti$+"by Stefano Maria Regattin|"
  535.       Crediti$+"from Blitz Basic 2.1|"
  536.       Crediti$+"paper manual"
  537.      End Select
  538.      EZRequest TitoloPannelloCrediti$,Crediti$,"OK"
  539. ;show the credits
  540.  
  541.     Case #VoceUno
  542.      Select Lingua
  543.      Case #Italiano
  544.       NuovaLingua=#Inglese
  545.      Case #Inglese
  546.       NuovaLingua=#Italiano
  547.      End Select
  548. ;select the new language
  549.  
  550.     Case #VoceDue
  551.      EsciDalProgramma=True
  552. ;exit from the program
  553.  
  554.     End Select
  555.    EndIf
  556.   EndIf
  557.  
  558.   If NuovaLingua>0 Then Lingua=NuovaLingua
  559.  
  560.   HaiChiusoLaFinestra.l=EventoFinestra & %0000001000000000
  561.   If HaiChiusoLaFinestra=#HaiChiusoLaFinestra Then EsciDalProgramma=True
  562. ;if the window has been closed
  563.  
  564.   HaiPremutoUnTasto.l=EventoFinestra & %0000010000000000
  565.   If HaiPremutoUnTasto=#HaiPremutoUnTasto
  566. ;if a key has been pressed
  567.  
  568.    TastoPremuto$=Inkey$
  569.    Select TastoPremuto$
  570.    Case TastoTabulazione$
  571. ;tabulation char
  572.  
  573.     BottoneAttivo+1:If BottoneAttivo=5 Then BottoneAttivo=0
  574.     MostraLaBaseCorrente{BottoneAttivo+1}
  575.    Case Invio$
  576. ;Return char
  577.  
  578.     ActivateString #FinestraConvertitore,BottoneAttivo
  579.     Redraw #FinestraConvertitore
  580.    Case TastoCursoreSu$
  581. ;cursor up char
  582.  
  583.     BottoneAttivo-1:If BottoneAttivo=-1 Then BottoneAttivo=4
  584.     MostraLaBaseCorrente{BottoneAttivo+1}
  585.    Case TastoCursoreGiu$
  586. ;cursor down char
  587.  
  588.     BottoneAttivo+1:If BottoneAttivo=5 Then BottoneAttivo=0
  589.     MostraLaBaseCorrente{BottoneAttivo+1}
  590.    Case TastoCursoreDestra$
  591. ;cursor right char
  592.  
  593.     BottoneAttivo+1:If BottoneAttivo=5 Then BottoneAttivo=0
  594.     MostraLaBaseCorrente{BottoneAttivo+1}
  595.    Case TastoCursoreSinistra$
  596. ;cursor left char
  597.  
  598.     BottoneAttivo-1:If BottoneAttivo=-1 Then BottoneAttivo=4
  599.     MostraLaBaseCorrente{BottoneAttivo+1}
  600.    Case TastoEsc$
  601. ;escape char
  602.  
  603.     EsciDalProgramma=True
  604.    End Select
  605.   EndIf
  606.  
  607.  Until EsciDalProgramma=True OR NuovaLingua>0
  608.  CloseWindow #FinestraConvertitore
  609. Until EsciDalProgramma=True
  610. FineDelProgramma
  611. End
  612.